The process of locating, analyzing, and fixing suspected errors in the code of a software application is referred to as “debugging.” A second software application commonly known as a “debugger” is often used to debug the first software application, which executes under the control of the debugger.
Although debuggers can support a wide range of features, they typically support two primary operations to perform the debugging. A first operation supported by standard debuggers is a “stepping” function, which permits the debugger to execute the instructions (also known as “statements”) of a software application one at a time, and display/analyze the results upon completion of each instruction. While the stepping function can provide a user with large amounts of information about the software application during its execution, stepping through several hundred or even several thousand instructions can be very time consuming, and may result in the user stepping through many software application instructions that are clearly error-free before arriving at the instructions the user desires to analyze and/or fix.
In this regard, a second function supported by debuggers is a “breakpoint” function, which permits the user to use a breakpoint to indicate a specific statement of the software application at which the execution of the software application should be stopped. In this way, when the software application is executed by the debugger, the software application executes in a normal manner until such a breakpoint is reached, and then stops executing and displays the results of the software application to the user for analysis.
Therefore, the stepping function and breakpoint functions may be used together to implement a debugging process as follows. Breakpoints are provided just before locations in the code of the software application that include a set of statements that the user wants to analyze, and then the software application is executed in a normal manner. Once a first such breakpoint is reached, the software application is halted, and the stepping function is used to execute the set of statements line by line in order to investigate the results of each statement separately. As a result, the user is able to quickly isolate and analyze a particular statement without having to use the stepping function to step through irrelevant statements of the software application.
The functionality of a debugger may be extended using a script to modify the debugger workflow. A script is a series of commands within a file (e.g., text file) that is capable of being executed by a computer without being compiled. A script is written in a scripting language, for example JavaScript which is a client side scripting language. The debugger application may define certain points (or these may be defined at a system level) during the debugger runtime wherein a user may add their own processing steps (e.g. calling a script). These entry points, which are called hooks, may be defined to allow for execution of custom operations based on specified constraints (e.g., rules) being satisfied during execution of the debugger application. For example, a hook may be automatically triggered before (prehook), after (posthook), or after an error (errorhook) of a normal operation (such as a debugger start/stop at a breakpoint).